import cv2
import numpy as np
import matplotlib.pyplot as plt

img = cv2.imread('cat_dog.jpg')
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)

# cv2.INTER_AREA: This is used when we need to shrink an image.
# cv2.INTER_CUBIC: This is slow but more efficient.
# cv2.INTER_LINEAR: This is primarily used when zooming is required. 
#                   This is the default interpolation technique in OpenCV.

half = cv2.resize(img, (0, 0), fx=0.2, fy=0.2)
bigger = cv2.resize(img, (600, 600))

stretch_near = cv2.resize(
    img, (700, 600), interpolation=cv2.INTER_LINEAR)

titles = ['Original', 'Half', 'Bigger', 'Interpolation Nearest']
images = [img, half, bigger, stretch_near]
count = 4

for i in range(count): 
    plt.subplot(2, 2, i + 1)
    plt.title(titles[i])
    plt.imshow(images[i])

plt.show()
